﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Web.Menus
{
    /// <summary>
    /// 表示式菜单特性
    /// </summary>
    [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)]
    public class SubMenuAttribute : MenuAttribute
    {
        /// <summary>
        /// 显示索引
        /// </summary>
        public int Index { get; set; }

        /// <summary>
        /// 表示式菜单特性
        /// </summary>
        /// <param name="index">显示索引</param>
        /// <param name="name">菜单名</param>
        /// <param name="controller">控制器</param>
        public SubMenuAttribute(int index, string name, string controller)
            : base(name, controller)
        {
            this.Index = index;
        }

        /// <summary>
        /// 表示式菜单特性
        /// </summary>
        /// <param name="index">显示索引</param>
        /// <param name="name">菜单名</param>
        /// <param name="controller">控制器</param>
        /// <param name="action">Action名</param>
        public SubMenuAttribute(int index, string name, string controller, string action)
            : this(index, name, controller)
        {
            this.ActionName = action;
        }
    }
}